﻿#region DaAssDgScore
/*----------------------------------------------------------------
// 文件名：DaAssDgScore.cs
// 功能描述：类AssDgScore的数据访问层
//
// 
// 创建时间：2009-07-10 DtataAccess template . Ver 5.0.20090413
//
// 修改标识： 
// 修改描述： 
//----------------------------------------------------------------*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Globalization;
using System.Text;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

using Las.Model; 


namespace Las.Dal
{
	///可以继承更上层接口,IAssDgScore ,数据访问层基类DaBase，
	///DaBase中包含了DbException异常处理静态方法
    public	partial  class DaAssDgScore:DaBase<MoAssDgScore>
    {	 
		#region SQL const
		internal const string TABLE_COLUMNS=" AKS_ID ,ASIS_ID ,ASS_DG_ID ,DG_NAME ,DG_TYPE ,ADI_ATTR ,ADS_ITEM_ID ,ADS_ITEM_NAME ,CJ ,CJ_STYLE ,MCJ ,CJ_STATUS ,CR_TIME ,CR_UID ,LU_UID ,LU_TIME ,REM   ";
		
		internal const string SQL_INSERT="INSERT INTO LA_ASS_DG_SCORE ("+TABLE_COLUMNS+") VALUES (@AksId,@AsisId,@AssDgId,@DgName,@DgType,@AdiAttr,@AdsItemId,@AdsItemName,@Cj,@CjStyle,@Mcj,@CjStatus,@CrTime,@CrUid,@LuUid,@LuTime,@Rem)";
		internal const string SQL_SELECT="SELECT "+TABLE_COLUMNS+" FROM LA_ASS_DG_SCORE  ";
		internal const string SQL_SELECT_ONE=SQL_SELECT+" WHERE AKS_ID=@AksId";                              
		
		internal const string SQL_EXIST="SELECT COUNT(*) FROM LA_ASS_DG_SCORE  WHERE AKS_ID=@AksId  ";
		internal const string SQL_UPDATE="UPDATE LA_ASS_DG_SCORE SET ASIS_ID=@AsisId, ASS_DG_ID=@AssDgId, DG_NAME=@DgName, DG_TYPE=@DgType, ADI_ATTR=@AdiAttr, ADS_ITEM_ID=@AdsItemId, ADS_ITEM_NAME=@AdsItemName, CJ=@Cj, CJ_STYLE=@CjStyle, MCJ=@Mcj, CJ_STATUS=@CjStatus, CR_TIME=@CrTime, CR_UID=@CrUid, LU_UID=@LuUid, LU_TIME=@LuTime, REM=@Rem WHERE AKS_ID=@AksId";
		
		internal const string SQL_DELETE_DEFAULT = "DELETE FROM LA_ASS_DG_SCORE ";
		internal const string SQL_DELETE="DELETE FROM LA_ASS_DG_SCORE WHERE AKS_ID=@AksId";
		
		internal const string SQL_COUNT="SELECT COUNT(*) FROM LA_Ass_DG_Score";
		#endregion
		       
		#region Constructor
	 
		/// <summary>
        /// 默认构造函数，使用配置文件中默认的数据库配置。
        /// </summary>
		public DaAssDgScore ()
		{ 
			this.db=DatabaseFactory.CreateDatabase();
		}
		/// <summary>
        /// 使用指定的databaseName数据库配置。
        /// </summary>
        /// <param name="databaseName">配置文件中数据库的配置名称。</param>
		public DaAssDgScore (string databaseName)
		{ 
            this.db = DatabaseFactory.CreateDatabase(databaseName);
		} 
		
		public DaAssDgScore (Database db)
		{ 
            this.db = db;
		} 
		
		#endregion
		
		//以下是CRUD方法，每个方法都有引入外部事务的版本

		#region 构造器模块
		
        protected override MoAssDgScore ConstructT()
        {
            return new MoAssDgScore();
        }
        #endregion
		
	    
		
		#region Add模块 Helper
		
		///build the command object.It never throw exception.
		protected override  DbCommand ConstructAddCommand(Database db)
		{
			DbCommand dbCommand = db.GetSqlStringCommand(SQL_INSERT);
			 
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"DgName",DbType.String);
			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32);
			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AdsItemName",DbType.String);
			db.AddInParameter(dbCommand,"Cj",DbType.Int32);
			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32);
			db.AddInParameter(dbCommand,"Mcj",DbType.Int32);
			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32);
			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime);
			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString);
			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString);
			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime);
			db.AddInParameter(dbCommand,"Rem",DbType.String);
			return dbCommand;
		}		
		protected override DbCommand ConstructAddCommand(Database db,MoAssDgScore entity)
		{
			DbCommand dbCommand=db.GetSqlStringCommand(SQL_INSERT);			 
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString,entity.AsisId);
			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString,entity.AssDgId);
			db.AddInParameter(dbCommand,"DgName",DbType.String,entity.DgName);
			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString,entity.DgType);
			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32,entity.AdiAttr);
			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString,entity.AdsItemId);
			db.AddInParameter(dbCommand,"AdsItemName",DbType.String,entity.AdsItemName);
			db.AddInParameter(dbCommand,"Cj",DbType.Int32,entity.Cj);
			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32,entity.CjStyle);
			db.AddInParameter(dbCommand,"Mcj",DbType.Int32,entity.Mcj);
			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32,entity.CjStatus);
			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime,entity.CrTime);
			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString,entity.CrUid);
			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString,entity.LuUid);
			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime,entity.LuTime);
			db.AddInParameter(dbCommand,"Rem",DbType.String,entity.Rem);
			return dbCommand;
		}
		
		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,MoAssDgScore entity)
		{
			db.SetParameterValue(addCmd,"AksId",entity.AksId);
			db.SetParameterValue(addCmd,"AsisId",entity.AsisId);
			db.SetParameterValue(addCmd,"AssDgId",entity.AssDgId);
			db.SetParameterValue(addCmd,"DgName",entity.DgName);
			db.SetParameterValue(addCmd,"DgType",entity.DgType);
			db.SetParameterValue(addCmd,"AdiAttr",entity.AdiAttr);
			db.SetParameterValue(addCmd,"AdsItemId",entity.AdsItemId);
			db.SetParameterValue(addCmd,"AdsItemName",entity.AdsItemName);
			db.SetParameterValue(addCmd,"Cj",entity.Cj);
			db.SetParameterValue(addCmd,"CjStyle",entity.CjStyle);
			db.SetParameterValue(addCmd,"Mcj",entity.Mcj);
			db.SetParameterValue(addCmd,"CjStatus",entity.CjStatus);
			db.SetParameterValue(addCmd,"CrTime",entity.CrTime);
			db.SetParameterValue(addCmd,"CrUid",entity.CrUid);
			db.SetParameterValue(addCmd,"LuUid",entity.LuUid);
			db.SetParameterValue(addCmd,"LuTime",entity.LuTime);
			db.SetParameterValue(addCmd,"Rem",entity.Rem);
			return addCmd;
		}
		
		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,DataRow row)
		{
			db.SetParameterValue(addCmd,"AksId",row["AksId"]);
			db.SetParameterValue(addCmd,"AsisId",row["AsisId"]);
			db.SetParameterValue(addCmd,"AssDgId",row["AssDgId"]);
			db.SetParameterValue(addCmd,"DgName",row["DgName"]);
			db.SetParameterValue(addCmd,"DgType",row["DgType"]);
			db.SetParameterValue(addCmd,"AdiAttr",row["AdiAttr"]);
			db.SetParameterValue(addCmd,"AdsItemId",row["AdsItemId"]);
			db.SetParameterValue(addCmd,"AdsItemName",row["AdsItemName"]);
			db.SetParameterValue(addCmd,"Cj",row["Cj"]);
			db.SetParameterValue(addCmd,"CjStyle",row["CjStyle"]);
			db.SetParameterValue(addCmd,"Mcj",row["Mcj"]);
			db.SetParameterValue(addCmd,"CjStatus",row["CjStatus"]);
			db.SetParameterValue(addCmd,"CrTime",row["CrTime"]);
			db.SetParameterValue(addCmd,"CrUid",row["CrUid"]);
			db.SetParameterValue(addCmd,"LuUid",row["LuUid"]);
			db.SetParameterValue(addCmd,"LuTime",row["LuTime"]);
			db.SetParameterValue(addCmd,"Rem",row["Rem"]);
			return addCmd;
		}
		
		#endregion
		    
		#region Update模块 Helper
		
		protected override DbCommand ConstructUpdateCommand(Database db)
		{
			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"DgName",DbType.String);
			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32);
			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString);
			db.AddInParameter(dbCommand,"AdsItemName",DbType.String);
			db.AddInParameter(dbCommand,"Cj",DbType.Int32);
			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32);
			db.AddInParameter(dbCommand,"Mcj",DbType.Int32);
			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32);
			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime);
			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString);
			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString);
			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime);
			db.AddInParameter(dbCommand,"Rem",DbType.String);
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString);
			 
			return dbCommand;
		}
		protected override DbCommand ConstructUpdateCommand(Database db,MoAssDgScore entity)
		{
			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString,entity.AsisId);
			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString,entity.AssDgId);
			db.AddInParameter(dbCommand,"DgName",DbType.String,entity.DgName);
			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString,entity.DgType);
			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32,entity.AdiAttr);
			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString,entity.AdsItemId);
			db.AddInParameter(dbCommand,"AdsItemName",DbType.String,entity.AdsItemName);
			db.AddInParameter(dbCommand,"Cj",DbType.Int32,entity.Cj);
			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32,entity.CjStyle);
			db.AddInParameter(dbCommand,"Mcj",DbType.Int32,entity.Mcj);
			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32,entity.CjStatus);
			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime,entity.CrTime);
			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString,entity.CrUid);
			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString,entity.LuUid);
			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime,entity.LuTime);
			db.AddInParameter(dbCommand,"Rem",DbType.String,entity.Rem);
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
			 
			return dbCommand;
		}
		
		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,MoAssDgScore entity)
		{
			db.SetParameterValue(updateCmd,"AsisId",entity.AsisId);
			db.SetParameterValue(updateCmd,"AssDgId",entity.AssDgId);
			db.SetParameterValue(updateCmd,"DgName",entity.DgName);
			db.SetParameterValue(updateCmd,"DgType",entity.DgType);
			db.SetParameterValue(updateCmd,"AdiAttr",entity.AdiAttr);
			db.SetParameterValue(updateCmd,"AdsItemId",entity.AdsItemId);
			db.SetParameterValue(updateCmd,"AdsItemName",entity.AdsItemName);
			db.SetParameterValue(updateCmd,"Cj",entity.Cj);
			db.SetParameterValue(updateCmd,"CjStyle",entity.CjStyle);
			db.SetParameterValue(updateCmd,"Mcj",entity.Mcj);
			db.SetParameterValue(updateCmd,"CjStatus",entity.CjStatus);
			db.SetParameterValue(updateCmd,"CrTime",entity.CrTime);
			db.SetParameterValue(updateCmd,"CrUid",entity.CrUid);
			db.SetParameterValue(updateCmd,"LuUid",entity.LuUid);
			db.SetParameterValue(updateCmd,"LuTime",entity.LuTime);
			db.SetParameterValue(updateCmd,"Rem",entity.Rem);
			db.SetParameterValue(updateCmd,"AksId",entity.AksId);
			return updateCmd;
		}
		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,DataRow row)
		{
			db.SetParameterValue(updateCmd,"AsisId",row["AsisId"]);
			db.SetParameterValue(updateCmd,"AssDgId",row["AssDgId"]);
			db.SetParameterValue(updateCmd,"DgName",row["DgName"]);
			db.SetParameterValue(updateCmd,"DgType",row["DgType"]);
			db.SetParameterValue(updateCmd,"AdiAttr",row["AdiAttr"]);
			db.SetParameterValue(updateCmd,"AdsItemId",row["AdsItemId"]);
			db.SetParameterValue(updateCmd,"AdsItemName",row["AdsItemName"]);
			db.SetParameterValue(updateCmd,"Cj",row["Cj"]);
			db.SetParameterValue(updateCmd,"CjStyle",row["CjStyle"]);
			db.SetParameterValue(updateCmd,"Mcj",row["Mcj"]);
			db.SetParameterValue(updateCmd,"CjStatus",row["CjStatus"]);
			db.SetParameterValue(updateCmd,"CrTime",row["CrTime"]);
			db.SetParameterValue(updateCmd,"CrUid",row["CrUid"]);
			db.SetParameterValue(updateCmd,"LuUid",row["LuUid"]);
			db.SetParameterValue(updateCmd,"LuTime",row["LuTime"]);
			db.SetParameterValue(updateCmd,"Rem",row["Rem"]);
			db.SetParameterValue(updateCmd,"AksId",row["AksId"]);
			return updateCmd;
		}
		
		protected override void PrepareDataAdapterCommand(Database db,out DbCommand dbInsertCommand,
		                     out DbCommand dbUpdateCommand,out DbCommand dbDeleteCommand)
		{
			dbInsertCommand = db.GetSqlStringCommand(SQL_INSERT);
			#region set insert cmd parameters
			db.AddInParameter(dbInsertCommand, "AksId",DbType.AnsiString, "AKS_ID", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "AsisId",DbType.AnsiString, "ASIS_ID", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "AssDgId",DbType.AnsiString, "ASS_DG_ID", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "DgName",DbType.String, "DG_NAME", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "DgType",DbType.AnsiString, "DG_TYPE", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "AdiAttr",DbType.Int32, "ADI_ATTR", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "AdsItemId",DbType.AnsiString, "ADS_ITEM_ID", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "AdsItemName",DbType.String, "ADS_ITEM_NAME", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "Cj",DbType.Int32, "CJ", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "CjStyle",DbType.Int32, "CJ_STYLE", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "Mcj",DbType.Int32, "MCJ", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "CjStatus",DbType.Int32, "CJ_STATUS", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "CrTime",DbType.DateTime, "CR_TIME", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "CrUid",DbType.AnsiString, "CR_UID", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "LuUid",DbType.AnsiString, "LU_UID", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "LuTime",DbType.DateTime, "LU_TIME", DataRowVersion.Current);
			db.AddInParameter(dbInsertCommand, "Rem",DbType.String, "REM", DataRowVersion.Current);
			#endregion
			dbUpdateCommand = db.GetSqlStringCommand(SQL_UPDATE);
			#region Set update cmd value parameters
			db.AddInParameter(dbUpdateCommand, "AsisId", DbType.AnsiString, "ASIS_ID", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "AssDgId", DbType.AnsiString, "ASS_DG_ID", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "DgName", DbType.String, "DG_NAME", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "DgType", DbType.AnsiString, "DG_TYPE", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "AdiAttr", DbType.Int32, "ADI_ATTR", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "AdsItemId", DbType.AnsiString, "ADS_ITEM_ID", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "AdsItemName", DbType.String, "ADS_ITEM_NAME", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "Cj", DbType.Int32, "CJ", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "CjStyle", DbType.Int32, "CJ_STYLE", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "Mcj", DbType.Int32, "MCJ", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "CjStatus", DbType.Int32, "CJ_STATUS", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "CrTime", DbType.DateTime, "CR_TIME", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "CrUid", DbType.AnsiString, "CR_UID", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "LuUid", DbType.AnsiString, "LU_UID", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "LuTime", DbType.DateTime, "LU_TIME", DataRowVersion.Current);
			db.AddInParameter(dbUpdateCommand, "Rem", DbType.String, "REM", DataRowVersion.Current);
			#endregion
			#region set update cmd pk where parameters
			db.AddInParameter(dbUpdateCommand, "AksId", DbType.AnsiString, "AKS_ID", DataRowVersion.Current);
			#endregion			
			dbDeleteCommand = db.GetSqlStringCommand(SQL_DELETE);
			#region set delete cmd pk where parameters
			db.AddInParameter(dbDeleteCommand, "AksId", DbType.AnsiString, "AKS_ID", DataRowVersion.Current);
			#endregion
		}
		#endregion	
		
		#region Delete模块 Helper		
		
		protected override DbCommand ConstructDeleteCommand(Database db)
		{
			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
			 
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString);
			 
			return dbCommand;
		}		
		protected override DbCommand ConstructDeleteCommand(Database db,MoAssDgScore entity)
		{
			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
			 
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
		 
			return dbCommand;
		}
		
		protected override DbCommand ConstructDeleteCommandForWhere(Database db, string where)
        {
            return db.GetSqlStringCommand(SQL_DELETE_DEFAULT + where);            
        }

        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, MoAssDgScore entity)
        {
			db.SetParameterValue(deleteCmd,"AksId",entity.AksId);
			return deleteCmd;
        }

        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, DataRow row)
        {
			db.SetParameterValue(deleteCmd,"AksId",row["AksId"]);
			return deleteCmd;
        }      
		
		#endregion helper
		
		#region Query模块 Helper

        protected override DbCommand ConstructQueryCommand(string condition)
        {
            return db.GetSqlStringCommand(SQL_SELECT + condition);
        }

        #endregion
		
		#region GetEntity(s)模块 Helper
        
		protected override DbCommand ConstructSelectOneCommand(Database db,MoAssDgScore entity)
		{
			DbCommand dbCommand=db.GetSqlStringCommand(SQL_SELECT_ONE);
			 
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
			return dbCommand;
		}
		
		protected override void PopulateEntityByDataReader(IDataReader reader,ref MoAssDgScore entity)
		{
			if (!reader.IsDBNull(0)) entity.AksId = reader.GetString(0);
			if (!reader.IsDBNull(1)) entity.AsisId = reader.GetString(1);
			if (!reader.IsDBNull(2)) entity.AssDgId = reader.GetString(2);
			if (!reader.IsDBNull(3)) entity.DgName = reader.GetString(3);
			if (!reader.IsDBNull(4)) entity.DgType = reader.GetString(4);
			if (!reader.IsDBNull(5)) entity.AdiAttr = reader.GetInt32(5);
			if (!reader.IsDBNull(6)) entity.AdsItemId = reader.GetString(6);
			if (!reader.IsDBNull(7)) entity.AdsItemName = reader.GetString(7);
			if (!reader.IsDBNull(8)) entity.Cj = reader.GetInt32(8);
			if (!reader.IsDBNull(9)) entity.CjStyle = reader.GetInt32(9);
			if (!reader.IsDBNull(10)) entity.Mcj = reader.GetInt32(10);
			if (!reader.IsDBNull(11)) entity.CjStatus = reader.GetInt32(11);
			if (!reader.IsDBNull(12)) entity.CrTime = reader.GetDateTime(12);
			if (!reader.IsDBNull(13)) entity.CrUid = reader.GetString(13);
			if (!reader.IsDBNull(14)) entity.LuUid = reader.GetString(14);
			if (!reader.IsDBNull(15)) entity.LuTime = reader.GetDateTime(15);
			if (!reader.IsDBNull(16)) entity.Rem = reader.GetString(16);
		}
		
		

        protected override DbCommand ConstructSelectConditionCommand(Database db, string condition)
        {
            return db.GetSqlStringCommand(SQL_SELECT + condition);
        }
		
		#endregion	
		
		#region Count模块 Helper

        protected override DbCommand ConstructCountCommand(Database db)
        {
            return db.GetSqlStringCommand(SQL_COUNT);
        }

        protected override DbCommand ConstructCountConditionCommand(Database db, string condition)
        {
            return db.GetSqlStringCommand(SQL_COUNT + condition);
        }

		#endregion
		
		#region IsExist模块 Helper

        protected override DbCommand ConstructIsExistCommand(Database db, MoAssDgScore entity)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_EXIST);
			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
			return dbCommand;
        }

		#endregion

		
		
	}
}	
#endregion

